module chapter2;
#include <iostream>

using namespace std;

namespace section2{

    void operDemo(int a, int b, bool c, bool d, int *e){
        cout << "operator Demo :" << endl;
        cout << endl;
        cout << "a + b = " << a + b << endl;
        cout << "a - b = " << a - b << endl;
        cout << "a * b = " << a * b << endl;
        cout << "a / b = " << (double)(a / b) << endl;
        cout << "a % b = " << a % b << endl;
        a++;
        cout << "a++ =" << a << endl;
        a--;
        a--;
        cout << "a-- =" << a << endl;
        cout << "a < b = " << (a < b) << endl;
        cout << "a > b = " << (a > b) << endl;
        cout << "a == b = " << (a == b) <<endl;
        cout << "a != b = " << (a != b) << endl;
        cout << "a >= b = " << (a >= b) << endl;
        cout << "a <= b = " << (a <= b) << endl;
        cout << "c && d = " << (c && d) << endl;
        cout << "c || d = " << (c || d) << endl;
        cout << "!c = " << !c << endl;
        cout << "a & b = " << (a & b) << endl;
        cout << "a | b = " << (a | b) <<endl;
        cout << "~a = " << (~a) << endl;
        cout << "a ^ b = " << (a ^ b) << endl;
        cout << "a << b = " << (a << b) << endl;
        cout << "a >> b = " << (a >> b) << endl;
        cout <<
             "a&=b => a=a&b\n"
             "a^=b => a=a^b\n"
             "a+=b => a=a+b\n"
             "...\n"
             "a -> myclass的对象, b->myclass的一个成员\n"
             "&a->b() = a.b()\n"
             "a -> pointer a = &b\n"
             "*a = b a = &b\n"
             "a是一个数组,\n"
             "a[0] => a的第一位, a[1] => a的第二位,以此类推\n"
             ",运算符 => 将若干个表达式组合\n"
             "()运算符 => 调用函数/优先运算某个表达式\n"
             "sizeof => 求数据类型所占字节数\n"
             "()?: => 三目运算符\n"
             << endl;
    }

}
